﻿using System.Windows;

namespace Geometry
{
    public interface IDraggable
    {
        void BeginDrag();
        void CancelDrag();
        void EndDrag();
        void DragBy(Vector amount);
        bool IsDragged { get; }
    }

    public class Draggable
    {
        public static IDraggable GetSource(DependencyObject obj)
        {
            return (IDraggable)obj.GetValue(SourceProperty);
        }

        public static void SetSource(DependencyObject obj, IDraggable value)
        {
            obj.SetValue(SourceProperty, value);
        }

        // Using a DependencyProperty as the backing store for Source.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SourceProperty =
            DependencyProperty.RegisterAttached("Source", typeof(IDraggable), typeof(Draggable), new UIPropertyMetadata(null));


    }
}
